package com.vitaf.cash.app.sdk.dec.util

import android.content.Context
import android.os.Build
import org.json.JSONObject

/**
 * device
 */
class GombeCreditUserDec1(val context: Context, val product: String, val token: String, val path: String) {

    fun takeUserDec1Data(): String? {
        return try {
            val data = JSONObject().apply {
                put("path", path)
                put("token", token)
                put("product", product)
                put("imei", "")
                put("version", "30")
                put("app", product)
                put("manufacturer", Build.MANUFACTURER ?: "")
                put("brand", Build.BRAND ?: "")
                put("deviceName", Build.DEVICE ?: "")
                put("phoneModel", Build.PRODUCT ?: "")
                put("sysVersion", Build.VERSION.RELEASE ?: "")
                put("mac", GombeCreditUserDecUtils.takeDec1Params7())
                put("laguage", GombeCreditUserDecUtils.takeDec1AndDec3Params1())
                put("area", GombeCreditUserDecUtils.takeDec1Params4())
                put("screenHeight", GombeCreditUserDecUtils.takeDec1Params2(context))
                put("screenWidth", GombeCreditUserDecUtils.takeDec1Params3(context))
                put("networkData", GombeCreditUserDecUtils.takeDec1AndDec3Params3(context))
                put("frontCameraPixels", GombeCreditUserDecUtils.takeDec1Params5(context))
                put("rearCameraPixels", GombeCreditUserDecUtils.takeDec1Params6(context))
                put("ram", GombeCreditUserDecUtils.takeDec1AndDec4Params1(context))
                put("rom", GombeCreditUserDecUtils.takeDec1AndDec4Params2())
                put("ip", GombeCreditUserDecUtils.takeDec1Params8(context))
                put("ip2", GombeCreditUserDecUtils.takeDec1Params8(context))
                put("networkEnvironment", GombeCreditUserDecUtils.takeDec1AndDec3Params2(context))
                put("cpu", GombeCreditUserDecUtils.takeDec1Params1())
            }
            data.toString()
        } catch (e: Exception) {
            null
        }
    }
}